@@ -48,7 +48,7 @@ android {
|
||
| 48 | 48 |
zipAlignEnabled false |
| 49 | 49 |
minifyEnabled false |
| 50 | 50 |
shrinkResources false |
| 51 |
- buildConfigField "boolean", "isTestMode", "false" |
|
| 51 |
+ buildConfigField "boolean", "isTestMode", "true" |
|
| 52 | 52 |
signingConfig signingConfigs.releaseConfig |
| 53 | 53 |
} |
| 54 | 54 |
} |
@@ -71,6 +71,12 @@ |
||
| 71 | 71 |
android:screenOrientation="portrait"/> |
| 72 | 72 |
|
| 73 | 73 |
<activity |
| 74 |
+ android:name=".activities.SessionQRCodeActivity" |
|
| 75 |
+ android:configChanges="keyboardHidden|orientation|screenSize" |
|
| 76 |
+ android:label="@string/app_name" |
|
| 77 |
+ android:screenOrientation="portrait"/> |
|
| 78 |
+ |
|
| 79 |
+ <activity |
|
| 74 | 80 |
android:name=".briefs.BriefsActivity" |
| 75 | 81 |
android:configChanges="keyboardHidden|orientation|screenSize" |
| 76 | 82 |
android:label="@string/app_name" |
@@ -0,0 +1,52 @@ |
||
| 1 |
+package ai.pai.lensman.activities; |
|
| 2 |
+ |
|
| 3 |
+import android.os.Bundle; |
|
| 4 |
+import android.text.TextUtils; |
|
| 5 |
+import android.view.View; |
|
| 6 |
+import android.widget.ImageView; |
|
| 7 |
+import android.widget.TextView; |
|
| 8 |
+ |
|
| 9 |
+import com.android.common.utils.DeviceUtils; |
|
| 10 |
+ |
|
| 11 |
+import ai.pai.lensman.R; |
|
| 12 |
+import ai.pai.lensman.base.BaseActivity; |
|
| 13 |
+import ai.pai.lensman.qrcode.QRCreateUtils; |
|
| 14 |
+import ai.pai.lensman.utils.SystemUtils; |
|
| 15 |
+import butterknife.BindView; |
|
| 16 |
+import butterknife.ButterKnife; |
|
| 17 |
+ |
|
| 18 |
+ |
|
| 19 |
+public class SessionQRCodeActivity extends BaseActivity {
|
|
| 20 |
+ |
|
| 21 |
+ private String qrcode; |
|
| 22 |
+ @BindView(R.id.iv_qrcode) ImageView qrCodeImg; |
|
| 23 |
+ |
|
| 24 |
+ @Override |
|
| 25 |
+ protected void onCreate(Bundle savedInstanceState) {
|
|
| 26 |
+ super.onCreate(savedInstanceState); |
|
| 27 |
+ setContentView(R.layout.activity_session_qrcode); |
|
| 28 |
+ unbinder = ButterKnife.bind(this); |
|
| 29 |
+ SystemUtils.setImmerseLayout(this, findViewById(R.id.title_layout)); |
|
| 30 |
+ TextView title = (TextView) findViewById(R.id.title_bar_middle_txt); |
|
| 31 |
+ title.setText(R.string.scan_qr); |
|
| 32 |
+ findViewById(R.id.title_bar_back_layout).setOnClickListener(new View.OnClickListener(){
|
|
| 33 |
+ @Override |
|
| 34 |
+ public void onClick(View v) {
|
|
| 35 |
+ finish(); |
|
| 36 |
+ } |
|
| 37 |
+ }); |
|
| 38 |
+ findViewById(R.id.title_bar_option_layout).setVisibility(View.INVISIBLE); |
|
| 39 |
+ qrcode = getIntent().getStringExtra("qrcode");
|
|
| 40 |
+ if(TextUtils.isEmpty(qrcode)){
|
|
| 41 |
+ finish(); |
|
| 42 |
+ return; |
|
| 43 |
+ } |
|
| 44 |
+ |
|
| 45 |
+ try{
|
|
| 46 |
+ qrCodeImg.setImageBitmap(QRCreateUtils.Create2DCode("http://pai.ai/s/"+qrcode,
|
|
| 47 |
+ DeviceUtils.dip2px(this,280))); |
|
| 48 |
+ }catch (Exception e){
|
|
| 49 |
+ e.printStackTrace(); |
|
| 50 |
+ } |
|
| 51 |
+ } |
|
| 52 |
+} |
@@ -19,6 +19,7 @@ import com.android.common.utils.NetworkUtil; |
||
| 19 | 19 |
import java.io.File; |
| 20 | 20 |
|
| 21 | 21 |
import ai.pai.lensman.R; |
| 22 |
+import ai.pai.lensman.activities.SessionQRCodeActivity; |
|
| 22 | 23 |
import ai.pai.lensman.base.BaseActivity; |
| 23 | 24 |
import ai.pai.lensman.bean.PhotoBean; |
| 24 | 25 |
import ai.pai.lensman.bean.SessionBean; |
@@ -116,7 +117,7 @@ public class SessionActivity extends BaseActivity implements SessionContract.Vie |
||
| 116 | 117 |
|
| 117 | 118 |
@OnClick(R.id.iv_qrcode) |
| 118 | 119 |
void showQRCodeForSession(){
|
| 119 |
- Intent intent = new Intent(this,PrinterSettingActivity.class); |
|
| 120 |
+ Intent intent = new Intent(this,SessionQRCodeActivity.class); |
|
| 120 | 121 |
intent.putExtra("qrcode",sessionBean.sessionId);
|
| 121 | 122 |
startActivity(intent); |
| 122 | 123 |
} |
@@ -223,7 +224,7 @@ public class SessionActivity extends BaseActivity implements SessionContract.Vie |
||
| 223 | 224 |
@Override |
| 224 | 225 |
public void onClick(View view) {
|
| 225 | 226 |
if(view.getId()==R.id.btn_print_qr){
|
| 226 |
- Intent intent = new Intent(this,PrinterSettingActivity.class); |
|
| 227 |
+ Intent intent = new Intent(this,SessionQRCodeActivity.class); |
|
| 227 | 228 |
intent.putExtra("qrcode",sessionBean.sessionId);
|
| 228 | 229 |
startActivity(intent); |
| 229 | 230 |
}else if(view.getId()==R.id.tv_printer_set){
|
@@ -0,0 +1,40 @@ |
||
| 1 |
+<?xml version="1.0" encoding="utf-8"?> |
|
| 2 |
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|
| 3 |
+ android:layout_width="match_parent" |
|
| 4 |
+ android:layout_height="match_parent" |
|
| 5 |
+ android:background="@color/background_light_grey_color"> |
|
| 6 |
+ |
|
| 7 |
+ <RelativeLayout |
|
| 8 |
+ android:id="@+id/title_layout" |
|
| 9 |
+ android:layout_width="match_parent" |
|
| 10 |
+ android:layout_height="wrap_content" |
|
| 11 |
+ android:background="@color/colorPrimaryDark"> |
|
| 12 |
+ <include layout="@layout/title_bar_with_back_and_option" /> |
|
| 13 |
+ </RelativeLayout> |
|
| 14 |
+ |
|
| 15 |
+ <LinearLayout |
|
| 16 |
+ android:layout_width="match_parent" |
|
| 17 |
+ android:layout_height="match_parent" |
|
| 18 |
+ android:layout_below="@id/title_layout" |
|
| 19 |
+ android:orientation="vertical"> |
|
| 20 |
+ |
|
| 21 |
+ <ImageView |
|
| 22 |
+ android:id="@+id/iv_qrcode" |
|
| 23 |
+ android:layout_width="280dp" |
|
| 24 |
+ android:layout_height="280dp" |
|
| 25 |
+ android:layout_gravity="center_horizontal" |
|
| 26 |
+ android:layout_margin="8dp"/> |
|
| 27 |
+ |
|
| 28 |
+ <TextView |
|
| 29 |
+ android:layout_width="match_parent" |
|
| 30 |
+ android:layout_height="wrap_content" |
|
| 31 |
+ android:gravity="center" |
|
| 32 |
+ android:layout_marginTop="8dp" |
|
| 33 |
+ android:text="@string/scan_qr_join_group" |
|
| 34 |
+ android:textColor="@color/dark_grey" |
|
| 35 |
+ android:textSize="18sp" /> |
|
| 36 |
+ |
|
| 37 |
+ </LinearLayout> |
|
| 38 |
+ |
|
| 39 |
+ |
|
| 40 |
+</RelativeLayout> |
@@ -5,7 +5,7 @@ buildscript {
|
||
| 5 | 5 |
jcenter() |
| 6 | 6 |
} |
| 7 | 7 |
dependencies {
|
| 8 |
- classpath 'com.android.tools.build:gradle:2.2.2' |
|
| 8 |
+ classpath 'com.android.tools.build:gradle:2.2.3' |
|
| 9 | 9 |
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' |
| 10 | 10 |
// NOTE: Do not place your application dependencies here; they belong |
| 11 | 11 |
// in the individual module build.gradle files |